package demo6;

import org.springframework.stereotype.Component;
//@Resource不是Spring框架提供的注解，是JAVAEE提供的注解
import javax.annotation.Resource;

@Component
public class Person {

    //@Resource
    //@Resource(name = "sweater")//类名注意，首字母小写，其余与类名完全一致即可
    //private Clothes clothes;
    @Resource
    private Clothes shirt;//还可以根据属性名装配，与类名一致（除了首字母小写）

    @Override
    public String toString() {
        return "Person{" +
                "clothes=" + shirt +
                '}';
    }
}
